import time

def silic(nums):

    arn = True
    while arn:
        arn = False
        for i in range(len(nums) - 1):
            if nums[i] > nums[i + 1]:

                nums[i], nums[i + 1] = nums[i + 1], nums[i]

                arn = True

def read2list(filename):
    file = open(filename, 'r')
    data = file.readlines()
    return data

OFFILE1 = read2list("m1_sorted.txt")
OFFILE2 = read2list("m2_reverse.txt")
OFFILE3 = read2list("m3_shuffle.txt")

start = time.time()
silic(OFFILE1)
finish = time.time()
print("m1_sorted",round((finish-start)*1000),"milliseconds")

start = time.time()
silic(OFFILE2)
t_finish = time.time()
print("m2_reverse",round((finish-start)*1000),"milliseconds")

start = time.time()
silic(OFFILE3)
finish = time.time()
print("m3_shuffle",round((finish-start)*1000),"milliseconds")
